package src.chapter2.test02;

import java.util.Random;
import java.util.Scanner;

public class homework {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}


class homework2 {
    public static void main(String[] args) {
        for(int x2 = 100 ; x2 < 300; x2 = x2 + 1) {
            if(x2 % 3 ==0 ){
                continue;
                }
                System.out.println(x2);
        }
    }
}


class homework3{
    public static void main(String[] args){
        for(int x3 = 1 ; x3 < 100 ; x3 += 1){
            if(x3==78){
                break;
            }
            System.out.println(x3);

        }
    }
}


class homework41{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入n：");
        int x4 = sc.nextInt();
        int y4 = 1;
        int sum =0;
        while( y4 <= x4 ) {
            sum+=y4;
            y4+=1;
        }
        System.out.println("sum:" + sum );
    }
}
class homework42{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入n：");
        int x4 = sc.nextInt();
        int y4 = 1;
        int sum =0;
        for( ;y4 <= x4 ;) {
            sum+=y4;
            y4+=1;
        }
        System.out.println("sum:" + sum );
    }
}
class homework43{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入n：");
        int x4 = sc.nextInt();
        int y4 = 1;
        int sum =0;
        do {
            sum+=y4;
            y4+=1;
        }while( y4 <= x4 );
        System.out.println("sum:" + sum );
    }
}


class homework5{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入你的成绩（1-5）：");
        int x5 = sc.nextInt();
        if(x5==1){
            System.out.println("不及格");
        }else if(x5==2){
            System.out.println("及格");
        }else if(x5==3){
            System.out.println("中等 ");
        }else if(x5==4){
            System.out.println("良好");
        }else if(x5==5){
            System.out.println("优秀");
        }else{
            System.out.println("请输入正确的成绩");
        }
    }
}


class homework6{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入你的成绩：");
        int x6 = sc.nextInt();
        if( x6>=85 ){
            System.out.println("A");
        }else if( x6>=70 ){
            System.out.println("B");
        }else if( x6>=60 ){
            System.out.println("C");
        }else{
            System.out.println("D");
        }
    }
}


class homework7{
    public static void main(String[] args){
        int i=(int)(Math.random()*100);
        while (true) {
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入你的答案：");
            int x7 = sc.nextInt();
            if (x7 < i) {
                System.out.println("小了");
            } else if (x7 > i) {
                System.out.println("大了");
            } else {
                System.out.println("对了！！！");
                break;
            }
        }
    }
}